def sum(n):
    if n == 0:
        return 0

    elif n == 1:
        return 1
    else:
        return n*sum(n-1)

n = int(input("请输入要计算到的数字："))
if n < 0:
    print("请输入正整数")
print("总积为{}".format(sum(n)))